package com.project.bean;

/**
 * 供货商表实体类
 */

import cn.afterturn.easypoi.excel.annotation.Excel;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

/**
 * @ExcelTarget限定一个到处实体的注解, 以及一些通用设置, 作用于最外面的实体
 *
 * @Excel注解的字段表示与Excel列映射,不添加此注解不会映射
 *  name:列标题
 *  orderNum:第几列
 *  width:列宽
 *  exportFormat:日期类型格式化，可指定格式（适用于Date类型）
 *  format 时间格式,相当于同时设置了exportFormat 和 importFormat（适用于Date类型）
 *  databaseFormat: 导出时间设置,如果字段是Date类型则不需要设置 数据库如果是string 类型,这个需要设置这个数据库格式,用以转换时间格式输出（适用于String类型）
 *  replace: String[]类型，值得替换  导出是{"男_1", "女_2"} 导入反过来
 *  suffix: 文字后缀,如%  90变成90%
 */
@Data
@Api(tags = "供货商视图")
@TableName(value = "sys_suppliers")
public class SuppliersBean {
    @ApiModelProperty(value = "编号",hidden = true)
    @TableId(value = "pk_suppliersId")
    @Excel(name = "序号", width = 10) //后期controller中将为id字段重新赋值，实现序号效果
    private int id;

    @ApiModelProperty(value = "供货商名称")
    @TableField(value = "suppliersName")
    @Excel(name = "供应商名",orderNum ="1",width = 30,isImportField = "true_su")
    private String suppliersName;

    @ApiModelProperty(value = "负责人")
    @TableField(value = "supplierManager")
    @Excel(name = "负责人",orderNum ="2",width = 30,isImportField = "true_su")
    private String supplierManager;

    @ApiModelProperty(value = "供应商电话")
    @TableField(value = "supplierPhone")
    @Excel(name = "电话",orderNum ="3",width = 30,isImportField = "true_su")
    private String supplierPhone;


    @ApiModelProperty(value = "供应商地址")
    @TableField(value = "supplierAddress")
    @Excel(name = "地址",orderNum ="4",width = 30,isImportField = "true_su")
    private String supplierAddress;

    @ApiModelProperty(value = "经营范围")
    @TableField(value = "supplierRange")
    @Excel(name = "经营范围",orderNum ="5",width = 30,isImportField = "true_su")
    private String supplierRange;

//    @TableField(exist = false)
//    private List<ProductBean>productList;

    public SuppliersBean() {
    }

    public SuppliersBean(String suppliersName, String supplierManager, String supplierPhone, String supplierAddress, String supplierRange) {
        this.suppliersName = suppliersName;
        this.supplierManager = supplierManager;
        this.supplierPhone = supplierPhone;
        this.supplierAddress = supplierAddress;
        this.supplierRange = supplierRange;
    }
}
